deleteData = function(selName, id, url) {
	var ids = "";
	if (selName == null) {
		ids = id;
	} else {
		var objs = $('input[name=' + selName + ']');
		var size = objs.length;
		$.each(objs, function(i, val) {
			if (objs[i].checked) {
				if (objs[i].value != "") {
					if (ids == "") {
						ids = objs[i].value;
					} else {
						ids = ids + "," + objs[i].value;
					}
				}
			}
		});
	}
	if (ids == "") {
		alert("请选择删除项！");
		return false;
	}
	var data = {};
	data.ids = ids;
	var check = confirm("您确定要提交表单吗？");
	if (check) {
		$.ajax({
			type : "post",
			url : url,
			dataType : "json",
			contentType : "application/json",
			data : JSON.stringify(data),
			success : function(result) {
				if (!result.flag) {
					alert("删除失败！原因：" + result.message);
				} else {
					location.reload();
				}
			}
		});
	}
	return true;
}

// 增驾类型Select控件.(控件对象, 是否需要第一选择项, 选择项提示, 是否选中)
createDriveApplyTypeOptions = function(selObj, needEmpty, itemName, isSelected) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option ' + (isSelected == true ? 'selected' : '') + ' value="">' + itemName + '</option>');
	}
	$.each(driveApplyType, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

createPhysicalStatusOptions = function(selObj, needEmpty) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option value=""></option>');
	}
	$.each(phyExamStatus, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

createIdCardStatusOptions = function(selObj, needEmpty) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option value=""></option>');
	}
	$.each(idCardStatus, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

createInfoSourceOptions = function(selObj, needEmpty) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option value=""></option>');
	}
	$.each(infoSource, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

// 驾照类型Select控件.(控件对象, 是否需要第一选择项, 选择项提示, 是否选中)
createDriveTypeOptions = function(selObj, needEmpty, itemName, isSelected) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option ' + (isSelected == true ? 'selected' : '') + ' value="">' + itemName + '</option>');
	}
	$.each(driveType, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

createSexTypeOptions = function(selObj, needEmpty) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option value=""></option>');
	}
	$.each(sexType, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

createIdCardTypeOptions = function(selObj, needEmpty) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option value=""></option>');
	}
	$.each(idCardType, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

createClassTypeOptions = function(selObj, needEmpty) {
	selObj.empty();
	if (needEmpty == true) {
		selObj.append('<option value=""></option>');
	}
	$.each(classType, function(i, val) {
		selObj.append('<option value="' + val.id + '">' + val.text + '</option>');
	});
}

getClassTypeName = function(classType) {
	if (classType == null)
		classType = "";
	$.each(driveType, function(i, val) {
		if (val.id == classType) {
			try {
				return val.type;
			} catch (e) {
				return "";
			}
		}
	});
}

// 设置Radio选中值.
checkRadios = function(name, value) {
	var types = $('input[name="' + name + '"]');
	$.each(types, function(i, radio) {
		if ($(radio).val() == value) {
			$(radio).attr("checked", true);
		}
	});
}